import service from '@/utils/request'
// import { createService } from '@/utils/request'
import { AxiosResponse } from 'axios'
import qs from 'qs'
import {LoginResult, reqUserLoginType} from "./type";
// const service = createService()
enum API {
    USER_LOGIN_URL = '/sysUser/user/login',
    USER_REGISTER_URL = '/sysUser/user/register',
    UPDATE_USER_INFO_URL = '/sysUser/user/update',
    GET_USER_INFO_URL = '/sysUser/user/self'
}

export const userLogin = (data: reqUserLoginType) => {
    return service.newsService.post<any,AxiosResponse<LoginResult>>(
      API.USER_LOGIN_URL,
        data,
    )
}

export const getuserInfo = () => {
    return service.newsService.get<any,AxiosResponse<any>>(
        API.GET_USER_INFO_URL
    )
}

